#include <REGX52.H>
#include <INTRINS.H>
#include "delay.h"
#include "MatrixLED.h"




//默认放在RAM里面的

//code关键字，把数组放到Flash里面
unsigned char code Animation [] = {
	/*--  调入了一幅图像：这是您新建的图像  --*/
	/*--  宽度x高度=32x8  --*/
	0x00,0x00,0x7D,0x00,0x00,0x00,0x00,0x00,
	0xFF,0x08,0x08,0x08,0xFF,0x00,0x3E,0x49,
	0x49,0x49,0x39,0x00,0xFF,0x01,0x02,0x00,
	0xFF,0x01,0x03,0x00,0x3E,0x41,0x41,0x3E,
	0x00,0x00,0x7D,0x00,0x00,0x00,0x00,0x00,
};

void main()
{
	unsigned char i = 0;
	unsigned char offset = 0;
	unsigned char count = 0;
	
	P0 = 0xFF;
	MatrixLED_Init();
	
	
	Animation[0] = 0x00;
	
	while(1)
	{
		
		for(i=0; i< 8; i++){
			MatrixLED_ShowColumn(i, Animation[i + offset]);
		}
		
		count++;
		if(count >= 20)
		{
			count = 0;
			
			offset++;
			if(offset > (40 - 8))
				offset = 0;
		}
	}
}
